package com.nuedu.corejava.ch10.homework;

import java.util.HashMap;
import java.util.Random;

public class TestBankDeositor {
	public static void main(String[] args) {
		//1.新建一个HashMap对象
		HashMap<String, BankDepositor> usermaMap = new  HashMap<String, BankDepositor>();
		
		//2.保存是个存储信息
		for(int i = 0; i<10;i++) {
			usermaMap.put("user"+i, new BankDepositor("user"+i,"user name"+i,new Random().nextInt(50000)));
			
		}
		
		//3.根据储户ID，查询储户余额
		String userID = "user8";
		BankDepositor bankDepositor = usermaMap.get(userID);
		System.out.println(bankDepositor.getBalance());
		
	}

}
